﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using FeedAntGame.Control;
using FeedAntGame.Sprite;

namespace FeedAntGame.Control
{
    class Ant : BaseControl
    {
        GraphicsDeviceManager graphics;
        public enum TYPE { PINK }
        TYPE type = TYPE.PINK;
        /************************************************************************/
        /*                      GET/SET                                                                     */
        /************************************************************************/
        
        internal TYPE Type
        {
            get { return type; }
            set 
            {
                type = value;
                createInstance(sprite.Position);
            }
        }

        /************************************************************************/
        /*                  Constructor                                                                     */
        /************************************************************************/
        public Ant(Game game, TYPE type, Vector2 position)
            :base(game)
        {
            this.type = type;
            this.graphics = ((GameFA)game).Graphics;
            createInstance(position);
        }

        protected override void createInstance(Vector2 position)
        {
            switch (type)
            {
                case TYPE.PINK:
                    sprite = new AntSprite(
                        Game.Content.Load<Texture2D>(@"Images\ant_go_down"),
                        Game.Content.Load<Texture2D>(@"Images\ant_go_up"),
                        Game.Content.Load<Texture2D>(@"Images\ant_go_right"),
                        Game.Content.Load<Texture2D>(@"Images\ant_go_up_right"),
                        Game.Content.Load<Texture2D>(@"Images\ant_go_down_right"),                        
                        Game.Content.Load<Texture2D>(@"Images\ant_turn_right_down_to_down"),
                        position, new Point(40,32),0,
                        new Point(0,0), new Point(1,3), new Vector2(0.2f,0.2f),300,null,0,0.5f,game
                        );
                    sprite.ScroreValue = 0.01f;
                    (sprite as AntSprite).Power = 500;
                    break;
            }
        }
    }
}
